package com.hjm.project.weaningGear.weaningGear.service.impl;

import java.util.List;
import com.hjm.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hjm.project.weaningGear.weaningGear.mapper.WeaningGearMapper;
import com.hjm.project.weaningGear.weaningGear.domain.WeaningGear;
import com.hjm.project.weaningGear.weaningGear.service.IWeaningGearService;
import com.hjm.common.utils.text.Convert;

/**
 * 撤机归档记录Service业务层处理
 * 
 * @author maker-platform
 * @date 2021-01-26
 */
@Service
public class WeaningGearServiceImpl implements IWeaningGearService 
{
    @Autowired
    private WeaningGearMapper weaningGearMapper;

    /**
     * 查询撤机归档记录
     * 
     * @param id 撤机归档记录ID
     * @return 撤机归档记录
     */
    @Override
    public WeaningGear selectWeaningGearById(Long id)
    {
        return weaningGearMapper.selectWeaningGearById(id);
    }

    /**
     * 查询撤机归档记录列表
     * 
     * @param weaningGear 撤机归档记录
     * @return 撤机归档记录
     */
    @Override
    public List<WeaningGear> selectWeaningGearList(WeaningGear weaningGear)
    {
        return weaningGearMapper.selectWeaningGearList(weaningGear);
    }

    /**
     * 新增撤机归档记录
     * 
     * @param weaningGear 撤机归档记录
     * @return 结果
     */
    @Override
    public int insertWeaningGear(WeaningGear weaningGear)
    {
        weaningGear.setCreateTime(DateUtils.getNowDate());
        return weaningGearMapper.insertWeaningGear(weaningGear);
    }

    /**
     * 修改撤机归档记录
     * 
     * @param weaningGear 撤机归档记录
     * @return 结果
     */
    @Override
    public int updateWeaningGear(WeaningGear weaningGear)
    {
        weaningGear.setUpdateTime(DateUtils.getNowDate());
        return weaningGearMapper.updateWeaningGear(weaningGear);
    }

    /**
     * 删除撤机归档记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWeaningGearByIds(String ids)
    {
        return weaningGearMapper.deleteWeaningGearByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除撤机归档记录信息
     * 
     * @param id 撤机归档记录ID
     * @return 结果
     */
    @Override
    public int deleteWeaningGearById(Long id)
    {
        return weaningGearMapper.deleteWeaningGearById(id);
    }
}
